package hh.util;

public final class Asserts {
    
    public static void empty(Object param) {
        if (CommonUtil.isEmpty(param)) {
            throw new IllegalArgumentException("参数不能为空");
        }
    }
    public static void empty(Object param, String msg, Object... args) {
        if (CommonUtil.isEmpty(param)) {
            throw new IllegalArgumentException(CommonUtil.format(msg, args));
        }
    }
    public static void notEmpty(Object param, String msg, Object... args) {
        if (CommonUtil.isNotEmpty(param)) {
            throw new IllegalArgumentException(CommonUtil.format(msg, args));
        }
    }



    public static void notNull(Object param, String msg, Object... args) {
        if (param!=null) {
            throw new IllegalArgumentException(CommonUtil.format(msg, args));
        }
    }



    public static void Null(Object param) {
        if (param==null) {
            throw new IllegalArgumentException("参数不能为null");
        }
    }
    public static void Null(Object param, String msg, Object... args) {
        if (param==null) {
            throw new IllegalArgumentException(CommonUtil.format(msg, args));
        }
    }



    public static void True(boolean condition, String msg, Object... args) {
        if (condition) {
            throw new IllegalArgumentException(CommonUtil.format(msg, args));
        }
    }



    public static void False(boolean condition, String msg, Object... args) {
        if (!condition) {
            throw new IllegalArgumentException(CommonUtil.format(msg, args));
        }
    }
}
